/*
  正则表达式校验 regular expression
 */

// ipv4校验正则
const regIp = /^((2[0-4][0-9])|(25[0-5])|(1[0-9]{0,2})|([1-9][0-9])|([1-9]))\.(((2[0-4][0-9])|(25[0-5])|(1[0-9]{0,2})|([1-9][0-9])|([0-9]))\.){2}((2[0-4][0-9])|(25[0-5])|(1[0-9]{0,2})|([1-9][0-9])|([1-9]))$/
const regNum3 = /^\d{3,}$/

// ipv4校验正则
export const isIP = (str) => {
  let patt = new RegExp(regIp)
  return patt.test(str)
}
// 大于等于3的数字
export const isNum3 = (num) => {
  let patt = new RegExp(regNum3)
  return patt.test(num)
}
